﻿using System.Collections.Generic;

namespace CrawlerLogFolder
{
    public class Solution
    {
        public int MinOperations(string[] logs)
        {
            var stack = new Stack<string>();
            foreach (var log in logs)
            {
                switch (log)
                {
                    case "../":
                        if (stack.Count > 0)
                        {
                            stack.Pop();
                        }
                        break;
                    case "./":
                        break;
                    default:
                        stack.Push(log);
                        break;
                }
            }

            return stack.Count;
        }
    }
}
